#!/usr/bin/env bash

# set -Eeuxo pipefail
set -Eeuo pipefail

FILE="${1}"

set +o pipefail
AUDIO_FORMAT="$(ffmpeg -i "${FILE}" 2>&1 | sed -n "s/^.*Stream.*: Audio: \([a-zA-Z0-9]*\).*/\1/p")"
set -o pipefail
# printf "audio format: %s\n" $(grep --color=always -G '^.*$' <<< "${AUDIO_FORMAT}")
printf "%s\n" "${AUDIO_FORMAT}"

